#!/bin/sh
count=1
maxcount=5

clear
./dialnetkeeper
pppd call dsl-provider #> /dev/null

until test -n "`ifconfig | grep ppp`" #|| [ "$count" -eq "$maxcount" ]
	do
		date
		echo "第$count次登录失败"
		sleep 3
		count=`expr $count + 1`
		clear
		./dialnetkeeper
		pppd call dsl-provider #> /dev/null
		if [ "$count" -eq "$maxcount" ]
		sleep 1
		then echo 拨号登录失败！检测帐号信息！
		./hangup.sh
		exit 0
		fi
		
	done
sleep 1
route add default dev ppp0
date
echo "第$count次网络连接成功"

